package gov.ornl.stucco;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Map;

import org.yaml.snakeyaml.Yaml;

public class ConfigLoader {
    private String configFile;

    public ConfigLoader() {
        configFile = "config.yaml";
    }

    public Map<String, Object> getConfig(String configHeading) throws FileNotFoundException {
        Yaml yaml = new Yaml();
        Map<String, Map<String, Object>> configMap = (Map<String, Map<String, Object>>) yaml.load(new FileInputStream(configFile));
        return configMap.get(configHeading);
    }

}
